package com.examples.mysql2mysql.stream;

import com.alibaba.fastjson.JSONObject;
import org.apache.flink.streaming.api.datastream.DataStream;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

public class MySQLFlink {

	/***
	 *  实时监控MySQL数据表,并处理
	 * **/
	public static void main(String[] args) throws Exception {
		final StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
		DataStream<JSONObject> dataStream = env
			.addSource(new Flink2JdbcReader());
		dataStream.addSink(new MySink()).setParallelism(10);
		env.execute();
	}
}
